
var path = require('path')
const NODE_ENV = process.env.NODE_ENV

module.exports = {
  build: {
    restfulApi:'http://47.98.150.81:7777',
    mode: NODE_ENV,
    sourceMap: false,
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    bundleAnalyzerReport: process.env.analyz
  },
  dev: {
    restfulApi:'http://127.0.0.1/api',
    mode: NODE_ENV,
    sourceMap: 'source-map',
    assetsRoot: path.resolve(__dirname, '../dist'),
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    port: 3000,
    autoOpenBrowser: true,
    overlay: true,
    historyApiFallback: true,
    noInfo: true,
    proxyTable: {
        '/api':{
            target:'http://47.98.150.81:7777',//跨域地址
            changeOrigin:true,//是否跨域
            secure:false,//是否使用https
            //pathRewrith:{
             //   '^api':'/api'//这里要理解成用'/api'代替target里面的地址，后面的组件中我们调用接口的时候直接用api代替，比如我要调用'http://40.00.100:3002/user/add'，直接写成'/api/user/add'即可
            //}
        }
    }
  },
}
